﻿using GoodFit.BLL.Function;
using GoodFit.BLL.Model;
using GoodFit.BLL.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace GoodFit.BLL.Controller
{
    public class TaskController : ApiController
    {
        static ITaskRepository taskRepository = new TaskRepository();

        public IEnumerable<MTask> GetAllUsers()
        {
            var task = taskRepository.GetAllTask();
            return task;
        }

        public MTask GetUserById(int id)
        {
            var task = taskRepository.GetMTaskById(id);
            return task;
        }
        public string AddTask(MTask task)
        {
            var response = taskRepository.AddTask(task);
            return response;
        }
        public void DeleteTask(int id)
        {
            taskRepository.DeleteTask(id);
        }
    }
}